using UnityEngine;
using System.Collections;

[System.Serializable]
public class SideScrollExternData
{
    #region  External forces
        public  Vector2         	m_vResistance;              // A force that opposes the velocity directionally
        public  Vector2         	m_vExternalAcceleration;    // A force aplied as an extra acceleration
        public 	Vector2         	m_vExternalConstVelocity;   // A constant velocity applyed externaly and independently
        public 	float	        	m_fExternalConstFriction;   // A constant force that oposes all movement
    #endregion
	
	public void Set(ref SideScrollExternData _newData)
	{
		m_vResistance				= _newData.m_vResistance;           
		m_vExternalAcceleration		= _newData.m_vExternalAcceleration; 
		m_vExternalConstVelocity	= _newData.m_vExternalConstVelocity;
		m_fExternalConstFriction	= _newData.m_fExternalConstFriction;
	}
	
	public void Blend(ref SideScrollExternData _newData, float _fBlendCoef)
	{
		m_vResistance				= Maths.Vec2Blend(ref m_vResistance				, ref _newData.m_vResistance			, _fBlendCoef);           
		m_vExternalAcceleration		= Maths.Vec2Blend(ref m_vExternalAcceleration	, ref _newData.m_vExternalAcceleration	, _fBlendCoef); 
		m_vExternalConstVelocity	= Maths.Vec2Blend(ref m_vExternalConstVelocity	, ref _newData.m_vExternalConstVelocity	, _fBlendCoef);
		m_fExternalConstFriction	= Maths.FloatBlend(	m_fExternalConstFriction	, _newData.m_fExternalConstFriction		, _fBlendCoef);
	}
}

